﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace Convert.CPIAMmodel
{
    public class RegisterReceiptHeader
    {
        public RegisterReceiptHeader(long lngReceiptNo, string lngOldReceiptNo, int registeringStoreID, DateTime dteReceiptTime, string strRegister, Guid guidClerkID, int iCnt, string strStatus, decimal decGSTAmt, decimal decTotDisc,
                                     decimal decSubTotal, decimal decCashOut, decimal decRounding, decimal decBalDue, string strPayMeth, decimal decTender, decimal decChange, string strClientNo, int intRegTillUpID, string strVoidReason)
        {
            this.RegReceiptID=lngReceiptNo;
            this.RegOldPOSReceiptID=lngOldReceiptNo;
            this.RegIssuingStoreID=registeringStoreID;
            this.RegDate = dteReceiptTime;
            this.RegNumber=strRegister;
            this.RegClerkID=guidClerkID;
            this.RegItems=iCnt;
            this.RegReceiptStatus=strStatus;
            this.RegGSTAmount=decGSTAmt;
            this.RegTotalDisc=decTotDisc;
            this.RegSubTotal=decSubTotal;
            this.RegCashOut=decCashOut;
            this.RegRounding=decRounding;
            this.RegBalDue=decBalDue;
            this.RegPayMeth=strPayMeth;
            this.RegTender=decTender;
            this.RegChange=decChange;
            this.RegClientNo=strClientNo;
            this.RegTillUpID=intRegTillUpID;
            this.RegVoidReason=strVoidReason;
        }

        private long _RegReceiptID;

        public long RegReceiptID
        {
            get { return _RegReceiptID; }
            set { _RegReceiptID = value; }
        }
        private string _RegOldPOSReceiptID;

        public string RegOldPOSReceiptID
        {
            get { return _RegOldPOSReceiptID; }
            set { _RegOldPOSReceiptID = value; }
        }
        private int _RegIssuingStoreID;

        public int RegIssuingStoreID
        {
            get { return _RegIssuingStoreID; }
            set { _RegIssuingStoreID = value; }
        }
        private DateTime _RegDate;

        public DateTime RegDate
        {
            get { return _RegDate; }
            set { _RegDate = value; }
        }
        private string _RegNumber;

        public string RegNumber
        {
            get { return _RegNumber; }
            set { _RegNumber = value; }
        }
        private Guid _RegClerkID;

        public Guid RegClerkID
        {
            get { return _RegClerkID; }
            set { _RegClerkID = value; }
        }
        private int _RegItems;

        public int RegItems
        {
            get { return _RegItems; }
            set { _RegItems = value; }
        }
            //private Boolean _RegReceiptPrinted;
        private string _RegReceiptStatus;

        public string RegReceiptStatus
        {
            get { return _RegReceiptStatus; }
            set { _RegReceiptStatus = value; }
        }
        private decimal _RegGSTAmount;

        public decimal RegGSTAmount
        {
            get { return _RegGSTAmount; }
            set { _RegGSTAmount = value; }
        }
        private decimal _RegTotalDisc;

        public decimal RegTotalDisc
        {
            get { return _RegTotalDisc; }
            set { _RegTotalDisc = value; }
        }
        private decimal _RegSubTotal;

        public decimal RegSubTotal
        {
            get { return _RegSubTotal; }
            set { _RegSubTotal = value; }
        }
        private decimal _RegCashOut;

        public decimal RegCashOut
        {
            get { return _RegCashOut; }
            set { _RegCashOut = value; }
        }
        private decimal _RegRounding;

        public decimal RegRounding
        {
            get { return _RegRounding; }
            set { _RegRounding = value; }
        }
        private decimal _RegBalDue;

        public decimal RegBalDue
        {
            get { return _RegBalDue; }
            set { _RegBalDue = value; }
        }
        private string _RegPayMeth;

        public string RegPayMeth
        {
            get { return _RegPayMeth; }
            set { _RegPayMeth = value; }
        }
        private decimal _RegTender;

        public decimal RegTender
        {
            get { return _RegTender; }
            set { _RegTender = value; }
        }
        private decimal _RegChange;

        public decimal RegChange
        {
            get { return _RegChange; }
            set { _RegChange = value; }
        }
            //private decimal _RegClubPointsEarned;
        private string _RegClientNo;

        public string RegClientNo
        {
            get { return _RegClientNo; }
            set { _RegClientNo = value; }
        }
        private int _RegTillUpID;

        public int RegTillUpID
        {
            get { return _RegTillUpID; }
            set { _RegTillUpID = value; }
        }
        private string _RegVoidReason;

        public string RegVoidReason
        {
            get { return _RegVoidReason; }
            set { _RegVoidReason = value; }
        }
            //private int _RegTillUpID;

        public static void SaveToDateTable(RegisterReceiptHeader registerReceiptHeader,DataTable RegisterReceiptHeaderDT)
        {
            RegisterReceiptHeaderDT.Rows.Add(
            registerReceiptHeader.RegReceiptID,
            registerReceiptHeader.RegOldPOSReceiptID,
            registerReceiptHeader.RegIssuingStoreID,
            registerReceiptHeader.RegDate,
            registerReceiptHeader.RegNumber,
            registerReceiptHeader.RegClerkID,
            registerReceiptHeader.RegItems,
            registerReceiptHeader.RegReceiptStatus,
            registerReceiptHeader.RegGSTAmount,
            registerReceiptHeader.RegTotalDisc,
            registerReceiptHeader.RegSubTotal,
            registerReceiptHeader.RegCashOut,
            registerReceiptHeader.RegRounding,
            registerReceiptHeader.RegBalDue,
            registerReceiptHeader.RegPayMeth,
            registerReceiptHeader.RegTender,
            registerReceiptHeader.RegChange,
            registerReceiptHeader.RegClientNo,
            registerReceiptHeader.RegTillUpID,
            registerReceiptHeader.RegVoidReason);
        }
    }

    public class RegisterPayments
    {
        public RegisterPayments(long lngReceiptNo, int registeringStoreID, string strPayMethDesc, string strPayMeth, decimal decBalDue, DateTime dteReceiptTime, string strClientNo, int intRegTillUpID, Guid guidRegPayGVSerialNo)
        {
            this.RegReceiptID = lngReceiptNo;
            this.RegIssuingStoreID = registeringStoreID;
            this.RegPayCode = strPayMeth;
            this.RegPayName = strPayMethDesc;
            this.RegPayAmount = decBalDue;
            this.RegPayDate = dteReceiptTime;
            this.RegClientNo = strClientNo;
            this.RegTillUpID = intRegTillUpID;
            this.RegPayGVSerialNo = guidRegPayGVSerialNo;
        }

        private long _RegReceiptID;

        public long RegReceiptID
        {
            get { return _RegReceiptID; }
            set { _RegReceiptID = value; }
        }
        private int _RegIssuingStoreID;

        public int RegIssuingStoreID
        {
            get { return _RegIssuingStoreID; }
            set { _RegIssuingStoreID = value; }
        }
        private string _RegPayName;

        public string RegPayName
        {
            get { return _RegPayName; }
            set { _RegPayName = value; }
        }
        private string _RegPayCode;

        public string RegPayCode
        {
            get { return _RegPayCode; }
            set { _RegPayCode = value; }
        }
        private decimal _RegPayAmount;

        public decimal RegPayAmount
        {
            get { return _RegPayAmount; }
            set { _RegPayAmount = value; }
        }
        private DateTime _RegPayDate;

        public DateTime RegPayDate
        {
            get { return _RegPayDate; }
            set { _RegPayDate = value; }
        }
        private string _RegClientNo;

        public string RegClientNo
        {
            get { return _RegClientNo; }
            set { _RegClientNo = value; }
        }
        private int _RegTillUpID;

        public int RegTillUpID
        {
            get { return _RegTillUpID; }
            set { _RegTillUpID = value; }
        }
        private Guid _RegPayGVSerialNo;

        public Guid RegPayGVSerialNo
        {
            get { return _RegPayGVSerialNo; }
            set { _RegPayGVSerialNo = value; }
        }

        public static void SaveToDateTable(RegisterPayments registerPayments,DataTable RegisterPaymentsDT)
        {
            RegisterPaymentsDT.Rows.Add(
            registerPayments.RegReceiptID,
            registerPayments.RegIssuingStoreID,
            registerPayments.RegPayName,
            registerPayments.RegPayCode,
            registerPayments.RegPayAmount,
            registerPayments.RegPayDate,
            registerPayments.RegClientNo,
            registerPayments.RegTillUpID,
            registerPayments.RegPayGVSerialNo);
        }

    }

    public class RegisterTransactions
    {
        private long _RegReceiptID;

        public long RegReceiptID
        {
            get { return _RegReceiptID; }
            set { _RegReceiptID = value; }
        }
        private long _TransIssuingStoreID;

        public long TransIssuingStoreID
        {
            get { return _TransIssuingStoreID; }
            set { _TransIssuingStoreID = value; }
        }
        private DateTime _TransDate;

        public DateTime TransDate
        {
            get { return _TransDate; }
            set { _TransDate = value; }
        }
        private int _TransDeptNo;

        public int TransDeptNo
        {
            get { return _TransDeptNo; }
            set { _TransDeptNo = value; }
        }
        private string _TransItemCode;

        public string TransItemCode
        {
            get { return _TransItemCode; }
            set { _TransItemCode = value; }
        }
        private int _TransStkNumber;

        public int TransStkNumber
        {
            get { return _TransStkNumber; }
            set { _TransStkNumber = value; }
        }
        private string _TransStkName;

        public string TransStkName
        {
            get { return _TransStkName; }
            set { _TransStkName = value; }
        }
        private int _TransQty;

        public int TransQty
        {
            get { return _TransQty; }
            set { _TransQty = value; }
        }
        private decimal _TransCostPrice;

        public decimal TransCostPrice
        {
            get { return _TransCostPrice; }
            set { _TransCostPrice = value; }
        }
        private decimal _TransAvgPrice;

        public decimal TransAvgPrice
        {
            get { return _TransAvgPrice; }
            set { _TransAvgPrice = value; }
        }
        private string _TransGSTCode;

        public string TransGSTCode
        {
            get { return _TransGSTCode; }
            set { _TransGSTCode = value; }
        }
        private decimal _TransGSTAmt;

        public decimal TransGSTAmt
        {
            get { return _TransGSTAmt; }
            set { _TransGSTAmt = value; }
        }
        private string _TransGSTMarker;

        public string TransGSTMarker
        {
            get { return _TransGSTMarker; }
            set { _TransGSTMarker = value; }
        }
        private decimal _TransSellPrice;

        public decimal TransSellPrice
        {
            get { return _TransSellPrice; }
            set { _TransSellPrice = value; }
        }
        private decimal _TransDiscPercent;

        public decimal TransDiscPercent
        {
            get { return _TransDiscPercent; }
            set { _TransDiscPercent = value; }
        }
        private decimal _TransDiscAmount;

        public decimal TransDiscAmount
        {
            get { return _TransDiscAmount; }
            set { _TransDiscAmount = value; }
        }
        private decimal _TransExtAmount;

        public decimal TransExtAmount
        {
            get { return _TransExtAmount; }
            set { _TransExtAmount = value; }
        }
        private decimal _TransGovtCon;

        public decimal TransGovtCon
        {
            get { return _TransGovtCon; }
            set { _TransGovtCon = value; }
        }
        private Guid _TransClerkID;

        public Guid TransClerkID
        {
            get { return _TransClerkID; }
            set { _TransClerkID = value; }
        }
        private Boolean _TransEthical;

        public Boolean TransEthical
        {
            get { return _TransEthical; }
            set { _TransEthical = value; }
        }
        private Guid _TransAgentNo;

        public Guid TransAgentNo
        {
            get { return _TransAgentNo; }
            set { _TransAgentNo = value; }
        }
        private Guid _TransDebtorNo;

        public Guid TransDebtorNo
        {
            get { return _TransDebtorNo; }
            set { _TransDebtorNo = value; }
        }
        private string _TransClientNo;

        public string TransClientNo
        {
            get { return _TransClientNo; }
            set { _TransClientNo = value; }
        }
        private Guid _TransGiftVouchNo;

        public Guid TransGiftVouchNo
        {
            get { return _TransGiftVouchNo; }
            set { _TransGiftVouchNo = value; }
        }
        private int _TransTillUpID;

        public int TransTillUpID
        {
            get { return _TransTillUpID; }
            set { _TransTillUpID = value; }
        }
        private string _TransItemMarker;

        public string TransItemMarker
        {
            get { return _TransItemMarker; }
            set { _TransItemMarker = value; }
        }

        public static void SaveToDateTable(DataTable RegisterTransactionsDT, RegisterTransactions registerTransactions)
        {
            RegisterTransactionsDT.Rows.Add(
            registerTransactions.RegReceiptID,          
            registerTransactions.TransIssuingStoreID,
            registerTransactions.TransDate,
            registerTransactions.TransDeptNo,
            registerTransactions.TransItemCode,
            registerTransactions.TransStkNumber,
            registerTransactions.TransStkName,
            registerTransactions.TransQty,
            registerTransactions.TransCostPrice,
            registerTransactions.TransAvgPrice,
            registerTransactions.TransGSTCode,
            registerTransactions.TransGSTAmt,
            registerTransactions.TransGSTMarker,
            registerTransactions.TransSellPrice,
            registerTransactions.TransDiscPercent,
            registerTransactions.TransDiscAmount,
            registerTransactions.TransExtAmount,
            registerTransactions.TransGovtCon,
            registerTransactions.TransClerkID,
            registerTransactions.TransEthical,
            registerTransactions.TransAgentNo,
            registerTransactions.TransDebtorNo,
            registerTransactions.TransClientNo,
            registerTransactions.TransGiftVouchNo,
            registerTransactions.TransTillUpID,
            registerTransactions.TransItemMarker);
        }
    }
}
